﻿
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
 
<title>jb-aptech毕业设计项目</TITLE>
<meta name="renderer" content="ie-comp">
 
<link href="../../css/style.css" rel="stylesheet" type="text/css">
<script src="script/common.js"></script>
<script src="script/validate.js"></script>
	<script src="../../js/vue.js"></script>
	<script src="../../js/jquery/jquery-1.5.2.min.js"></script>
		<link rel="stylesheet" type="text/css" href="ExtJS/resources/css/ext-all.css">
<script type="text/javascript" src="ExtJS/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ExtJS/ext-all.js"></script>
</head>
  	<script type="text/javascript">
  		
  		function mySearch(){
  				var arrName=new Array();
				arrName[0]="usrName";
				checkWay(arrName);
  			document.sysUserForm.submit();
  		}
  	</script>
  <body>
  <div id="app">
    <div class="page_title">权限管理 > 用户管理 > 系统用户管理</div>

    <input type="hidden" name="method" value="userForward">
    	<div class="button_bar">
	   		<button class="common_button" onclick="help('');">帮助</button>
	   		<a class="common_button" href="add.html">新建</a>
			<button class="common_button" @click="load()">查询</button>
	   	</div>
	   	<table class="query_form_table">
	   		<tr>
	   			<th>
	   				用户名
	   			</th>
	   			<td>
	   				<input type="text" v-model="sums.usr_name" size="20" value="" id="usrName">
	   			</td>
	   			<th>
	   				是否禁用
	   			</th>
	   			<td>
	   				<select v-model="sums.usr_flag" id="usrFlag"><option value="">全部</option>
	   					<option value="1">正常</option>
	   					<option value="2">禁用</option></select>
	   			</td>
				<td><button @click="load()">查询</button></td>
	   		</tr>
	   	</table>
	   	<br/>
	   	<table class="data_list_table">
	   		<tr>
	   			<th>编号</th>
	   			<th>用户名</th>
	   			<th>角色</th>
	   			<th>状态</th>
	   			<th>操作</th>
	   		</tr>
 
	   		
	   		<tr v-for="u in sum">
	   			<td class="list_data_text" v-text="u.usr_id">2</td>
	   			<td class="list_data_text" v-text="u.usr_name">hlliu</td>
	   			<td class="list_data_text" v-text="u.role_name">管理员</td>

	   			<td class="list_data_text" v-if="u.usr_flag==1">
	   					正常
	   			</td>
				<td class="list_data_text" v-if="u.usr_flag==2">
					禁用
				</td>
	   			<td class="list_data_op">
	   				
	   					<img  @click="xg(u.usr_id)" title="编辑" src="images/bt_edit.gif" class="op_button" />
	   					<img @click="zp(u.usr_id)" title="指派" src="images/bt_linkman.gif" class="op_button" />
	   				
	   				<img @click="show(u.usr_id)" title="查看" src="images/bt_deal.gif" class="op_button" />
	   				
	   					<img  @click="del(u.usr_id)" title="删除" src="images/bt_del.gif" class="op_button" />
	   				
	   			</td>
	   		</tr>
	   		<tr>
		<th colspan="7" class="pager">
<div>
	<div class="row">
		<div class="mx-auto" id="lin">
			<!--                <a href="javascript:;" @click="emp.pageNum=pageInfo.pageNum-1;load()">上一页</a>-->
			<!--                <a href="javascript:;" @click="emp.pageNum=pageInfo.pageNum+1;load()">下一页</a>-->
			<ul class="pagination">
				<li class="page-item" :class="{'disabled':pageInfo.isFirstPage}"><a class="page-link" href="#" @click.capture="sums.pageNum=pageInfo.pageNum-1;load()">上一页</a></li>

				<li class="page-item"  :class="{'active':p==pageInfo.pageNum}"  v-for="p in pageInfo.navigatepageNums">
					<a class="page-link" href="#" @click.capture="sums.pageNum=p;load()">{{p}}</a></li>

				<li class="page-item" :class="{'disabled':pageInfo.isLastPage}"><a class="page-link" href="#" @click.capture="sums.pageNum=pageInfo.pageNum+1;load()">下一页</a></li>
			</ul>
		</div>
	</div>
</div>
		</th>
	</tr>
	   	</table>

  </div>
  </body>
<script>
	const  app=new Vue({
		el: "#app",
		data: {
			sum: [],
			sums: {
				usr_name: "",
				usr_flag: "",
				pageSize: 4,
				pageNum: 1,
			},
		}, methods: {
			load() {
				$.getJSON("/SysUser/queryPages", this.sums, json => {
					this.pageInfo = json.data.pageInfo;
					this.sum = json.data.pageInfo.list;
				});
			}, del(id) {
				$.post("/SysUser/delById/" + id, json => {
					if (json.message == "OK") {
						alert("删除成功");
						location.href = "list.html";
					} else {
						alert("删除失败");
						location.href = "html/~right/user/list.html";
					}
				})
			}, zp(id) {
				location = "dispatch.html?usr_id=" + id;
			}, show(id) {
				location = "detail.html?usr_id=" + id;
			}, xg(id) {
				location = "edit.html?usr_id=" + id;
			}
		}, mounted() {
			this.load();
		}
	});
</script>
<style>
	ul li{
		list-style: none;
	}
	#lin li{
		float: left;

		margin-left:10px;

		width: 100px;

		line-height: 30px;

	}
</style>
</html>
